package com.liang.reader;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class ReaderDemo {
    public static void main(String[] args) {
        FileReader fr = null;
        FileWriter fw = null;
        try {
            fr = new FileReader("day_13\\a.txt");
            fw = new FileWriter("day_13\\copy.txt");

            char[] b = new char[1024];
            int len;

            while ((len = fr.read(b)) != -1) {
                fw.write(b, 0, len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fr!=null&&fw!=null)
            try {
                fw.close();
                fr.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
